<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Tuvi_model extends CI_Model {

    function __construct()
    {
        parent::__construct();
        $this->load->database();
    }

    function getListTitleNew() {
        $sql = "SELECT id, ages FROM t_tuvi";
        $query = $this->db->query($sql);
        return $query->result_array();
    }

    function getTuviById($id) {
        $sql = "SELECT * FROM t_tuvi WHERE id = ?";
        $query = $this->db->query($sql, array($id));
        if ($query->num_rows() < 1) {
            return null;
        }
        return $query->row_array();
    }
}